﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ISIM
{
    public partial class VideoRenderForm : Form
    {
        SkypeClass.Participant mySelf;
        public VideoRenderForm()
        {
            InitializeComponent();
        }

        private void VideoRenderForm_Load(object sender, EventArgs e)
        {
            mySelf = Global.OpenForms.mainForm.skype.skypeLiveSession.GetParticipants(SkypeKit.SktConversation.PARTICIPANTFILTER.MYSELF)[0] as SkypeClass.Participant;
        }

        private void VideoRenderForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            mySelf.StopVideo();
        }

        private void VideoRenderForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Global.OpenForms.videoRenderForm = null;
        }

        private void showHideVideo_Click(object sender, EventArgs e)
        {
            if ((mySelf == null) || (mySelf.video == null)) return;

            if (mySelf.video.P_STATUS == SkypeKit.SktVideo.STATUS.RUNNING)
                mySelf.StopVideo();
            else
                mySelf.StartVideo();
        }

        private void VideoRenderForm_Resize(object sender, EventArgs e)
        {
            showHideVideo.Location = new Point(this.ClientSize.Width - showHideVideo.Width, this.ClientSize.Height - showHideVideo.Height);
        }
    }
}
